<?php
namespace Home\Controller;
use Think\Controller;
class TagsController extends Controller {

   //文章标签
   public function news(){
        $Model = M('News');
        $where = array();
        if (I('key')) {
            $where['sort'] = array('like', '%'.I('key').'%');
        }
        $where['state'] = 1;
        $this->list = $Model->Where($where)->order('addtime desc')->Select();
        $this->display();
   }
   //心情标签
   public function mood(){
        $Model = M('Mood');
        $where = array();
        if (I('key')) {
            $where['sort'] = array('like', '%'.I('key').'%');
        }
        $where['state'] = 1;
        $this->list = $Model->Where($where)->order('addtime desc')->Select();
        $this->display();
   }
   //相册标签
   public function photo(){
        $Model = M('Photo');
        $where = array();
        if (I('key')) {
            $where['sort'] = array('like', '%'.I('key').'%');
        }
        $where['state'] = 1;
        $this->list = $Model->Where($where)->order('addtime desc')->Select();
        $this->display();
   }
}